/*
* @Author: zhenghao01
* @Date:   2021-08-18 17:59:03
* @Last Modified by:   Administrator
* @Last Modified time: 2021-08-18 22:15:38
*/
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports={
	mode:'development',
	entry:'./src/index.js',
	devServer:{
		port:'9000',
		hot:true,
		open:true,
		contentBase:path.resolve(__dirname,'dist')
	},
	resolve:{
		extensions:['.js','.scss'],
		alias:{
          	style:path.resolve(__dirname,'./src/style/')
	    }
	},
	externals:{
		jquery:'$',
		underscore:'_'
	},
	output:{
		filename:'bundle.js',
		path:path.resolve(__dirname,'dist')
	},
	module:{
		rules:[
			{
				test:/\.scss$/,
				use:['style-loader','css-loader','sass-loader']
			}
		]
	},
	plugins:[
		new HtmlWebpackPlugin({
			template:'./public/index.html',
			title:'插件的使用',
			inject:'body',
			hash:true
		})
	]
}